package org.example.yunshu.demos.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.yunshu.demos.model.Add;
import org.example.yunshu.demos.model.Friend;
import org.example.yunshu.demos.model.UserInfo;

import java.util.List;

@Mapper
public interface FriendMapper {
    Friend[] getFriendListBySessionId(@Param("sessionId") Integer sessionId,
                                      @Param("excludeId") Integer excludeId);

    Friend[] getAllFriendListBySessionId(@Param("sessionId") Integer sessionId);
    List<Friend> getFriendListByUserId(UserInfo userInfo);

    int deleteFriend(@Param("userId") Integer userId,@Param("friendId") Integer friendId);

    Integer selectFriendId(@Param("friendName") String friendName);

    List<Friend> search(@Param("key") String keyword, @Param("userId") Integer userId);

    List<Add> getAddList(@Param("userId") Integer userId);

    void addFriend(@Param("userId") Integer userId,@Param("fromId") Integer fromId);
}
